﻿using System;

namespace NEnsure.Validators
{
	public class ValidationEventArgs : EventArgs, ICancelable
	{
		private readonly DateTime _when;
		private readonly IRuleContainer[] _containers;
		private bool _cancel;

		public DateTime When
		{
			get { return _when; }
		}

		public IRuleContainer[] Containers
		{
			get { return _containers; }
		}

		public bool Cancel
		{
			get { return _cancel; }
			set { _cancel = value; }
		}

		public ValidationEventArgs(IRuleContainer[] containers)
		{
			_when = DateTime.Now;
			_containers = containers;
		}
	}
}
